package what.the.fun.jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

import what.the.fun.domain.AnswerStatistic;

public class AnswerStatisticExtractor implements ResultSetExtractor<AnswerStatistic>{

	@Override
	public AnswerStatistic extractData(ResultSet arg0) throws SQLException,
			DataAccessException {
		AnswerStatistic data = new AnswerStatistic();
		data.setAnswerId(arg0.getString(1));
		data.setCount(arg0.getInt(2));
		
		return data;
	}

}
